package com.bw.myapply_module.myapply.adapter

import android.graphics.Color
import android.widget.RelativeLayout
import com.bigkoo.pickerview.view.WheelTime.dateFormat
import com.bw.myapply_module.R
import com.bw.myapply_module.myapply.entity.ApplyEntity
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import java.text.SimpleDateFormat
import java.util.*

class ApplyAdapter : BaseMultiItemQuickAdapter<ApplyEntity, BaseViewHolder>() {
    init {
        addItemType(0,R.layout.item_apply_come)
        addItemType(1,R.layout.item_apply_car)
        addItemType(2,R.layout.item_patrol)
        addItemType(3,R.layout.item_repairs)
        addChildClickViewIds(R.id.item_come_next)
    }

    override fun convert(holder: BaseViewHolder, item: ApplyEntity) {
        when (item.itemType) {
            0 -> {
                //访客
                holder.setText(R.id.item_come_titles,item.title)
                holder.setText(R.id.item_apply_come_data, item.applyTime)
            }
            1 -> {
                //申请
                holder.setText(R.id.item_apply_start_time, item.applyTime)
                holder.setText(R.id.item_apply_type,item.title)
            }
            2 -> {
                //维修
            }
        }
    }

}